package com.chx.utils;

import java.util.Random;

public class SaltUtils {

    private static final String STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890*@&$#";

    public static String getSalt(int size){
        char[] chars = STR.toCharArray();
        StringBuffer sb=new StringBuffer();
        for(int i=0;i<size;i++){
            char aChar = chars[new Random().nextInt(chars.length)];
            sb.append(aChar);
        }
        return sb.toString();
    }
}
